import request from "@/utils/request.js";

// 获取默认地址
let default_address = (data) => request.get('/address/default', data);

// 订单确认
let confirm_order = (data) => request.post('/order/confirm', data);

// 订单可以使用优惠券列表
let coupons_list = (price, data) => request.get(`/coupons/order/${price}`, data);

// 计算订单金额
let order_money = (key, data) => request.post(`/order/computed/${key}`, data);

// 购物车编号
let cart_num = (key, data) => request.post('/order/check_shipping', data);

// 订单创建
let order_create = (key, data) => request.post(`/order/create/${key}`, data);

// 获取订单倒计时
let order_detail = (orderId, data) => request.get(`/order/cashier/${orderId}/order`, data);

// 订单支付
let pay_order = (data) => request.post('/order/pay', data);

// 订单列表
let order_list = (data) => request.get('/order/list', data);

// 订单取消
let cancel_order = (data) => request.post('/order/cancel', data);

export default {
	default_address,
	confirm_order,
	coupons_list,
	order_money,
	cart_num,
	order_create,
	order_detail,
	pay_order,
	order_list,
	cancel_order,
}